package cn.sumpu.app.guoguojie.domain;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import cn.sumpu.app.guoguojie.constant.Expression;
import cn.sumpu.app.guoguojie.util.Common;

public class Doing implements Serializable {
	private static final long serialVersionUID = 163804985818396999L;

	private String identifier;
	private String member;
	private String family;
	private String content;
	private Boolean isForward;
	private Integer viewAmount;
	private Integer replyAmount;
	private Integer loveAmount;
	private Integer totalIPViewCount;
	private String shareType;
	
	private List<DoingProduct> doingProductList = new ArrayList<DoingProduct>();
	private List<DoingPicture> doingPictureList = new ArrayList<DoingPicture>();
	
	private String imageServer;
	private String postIp;
	private Date gmtCreated;
	private Date gmtModified;
	private Integer forwards;
	private String rootId;
	private String toId;
	private String toMember;
	private String type;
	private String videoUrl;
	private String videoPic;
	private String owner;
	private String ownerType;
	private Boolean enabled;
	// 当前微博的类型
	private String baseType;
	private Doing rootDoing;
	//会员信息
	private Member memberObj;
	private String memberName;
	private String memberAvatar;
	private String memberImageServer;
	private String memberApproveStatus;
	private String doorplate;
	//系统根据产品的内容自动添加的标签
	private String systemTag;
	//微博用户自定义标签
	private String tag;
	
//	所属画报
	private String pictorial;
	private DoingPictorial pictorialObj;
	//画报的6张图片
	private List<String> picList6;
	
	//这条微博的评论集合
	List<Comment> commentList = new ArrayList<Comment>();

	//这条微博的评论数量
	private Integer commentCount;
	
	//内容表
	private String contentTitle;
	private String contentDescription;
	private String contentPicture;
	private String contentHyperlink;
	private String contentNickname;
	private Date orderTime;
	
	List<Doing> replyPostsList = new ArrayList<Doing>();//帖子回复集合
	

	public Member getMemberObj() {
        return memberObj;
    }

    public void setMemberObj(Member memberObj) {
        this.memberObj = memberObj;
    }

    public String getShareType() {
        return shareType;
    }

    public void setShareType(String shareType) {
        this.shareType = shareType;
    }

    public String getOrderTime() {
		return Common.getDate(orderTime);
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public List<String> getPicList6() {
		return picList6;
	}

	public void setPicList6(List<String> picList6) {
		this.picList6 = picList6;
	}

	public List<Doing> getReplyPostsList() {
		return replyPostsList;
	}


	public void setReplyPostsList(List<Doing> replyPostsList) {
		this.replyPostsList = replyPostsList;
	}


	public String getContentTitle() {
		return contentTitle;
	}


	public void setContentTitle(String contentTitle) {
		this.contentTitle = contentTitle;
	}


	public String getContentDescription() {
		return contentDescription;
	}


	public void setContentDescription(String contentDescription) {
		this.contentDescription = contentDescription;
	}


	public String getContentPicture() {
		return contentPicture;
	}


	public void setContentPicture(String contentPicture) {
		this.contentPicture = contentPicture;
	}


	public String getContentHyperlink() {
		return contentHyperlink;
	}


	public void setContentHyperlink(String contentHyperlink) {
		this.contentHyperlink = contentHyperlink;
	}


	public String getContentNickname() {
		return contentNickname;
	}


	public void setContentNickname(String contentNickname) {
		this.contentNickname = contentNickname;
	}

	private List<Doing> doingReplyList = new ArrayList<Doing>();
	
	private Integer doingLoveCount;
	
	
	public Integer getDoingLoveCount() {
		return doingLoveCount;
	}


	public void setDoingLoveCount(Integer doingLoveCount) {
		this.doingLoveCount = doingLoveCount;
	}


	public List<Doing> getDoingReplyList() {
		return doingReplyList;
	}


	public void setDoingReplyList(List<Doing> doingReplyList) {
		this.doingReplyList = doingReplyList;
	}




	public void setSystemTag(String systemTag) {
		this.systemTag = systemTag;
	}


	public String getSystemTag() {
		return systemTag;
	}
	

	public Integer getCommentCount() {
		return commentCount;
	}

	public void setCommentCount(Integer commentCount) {
		this.commentCount = commentCount;
	}

	public List<Comment> getCommentList() {
		return commentList;
	}

	public void setCommentList(List<Comment> commentList) {
		this.commentList = commentList;
	}

	public String getDoorplate() {
		return doorplate;
	}

	public void setDoorplate(String doorplate) {
		this.doorplate = doorplate;
	}

	public String getTag() {
		return tag;
	}

	public void setTag(String tag) {
		this.tag = tag;
	}

	public Integer getAllCount(){
		if(this.replyAmount!=null && this.forwards!=null){
			return this.replyAmount+this.forwards;
		}else if(this.replyAmount==null && this.forwards==null){
			return 0;
		}else if(this.replyAmount==null && this.forwards!=null){
			return this.forwards;
		}else{
			return this.replyAmount;
		}
	}
	
	public String getMemberImageServer() {
		return memberImageServer;
	}

	public void setMemberImageServer(String memberImageServer) {
		this.memberImageServer = memberImageServer;
	}

	

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public String getIdentifier() {
		return identifier;
	}

	public void setIdentifier(String identifier) {
		this.identifier = identifier;
	}

	public String getMember() {
		return member;
	}

	public void setMember(String member) {
		this.member = member;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Boolean getIsForward() {
		return isForward;
	}

	public void setIsForward(Boolean isForward) {
		this.isForward = isForward;
	}

	public Integer getViewAmount() {
		return viewAmount;
	}

	public void setViewAmount(Integer viewAmount) {
		this.viewAmount = viewAmount;
	}

	public Integer getReplyAmount() {
		return replyAmount;
	}

	public void setReplyAmount(Integer replyAmount) {
		this.replyAmount = replyAmount;
	}

	public String getPostIp() {
		return postIp;
	}

	public void setPostIp(String postIp) {
		this.postIp = postIp;
	}

	public Date getGmtCreated() {
		return gmtCreated;
	}

	public void setGmtCreated(Date gmtCreated) {
		this.gmtCreated = gmtCreated;
	}

	public Date getGmtModified() {
		return gmtModified;
	}

	public void setGmtModified(Date gmtModified) {
		this.gmtModified = gmtModified;
	}

	public String getFamily() {
		return family;
	}

	public void setFamily(String family) {
		this.family = family;
	}

	public String getMemberName() {
		return memberName;
	}

	public void setMemberName(String memberName) {
		this.memberName = memberName;
	}

	public String getMemberAvatar() {
		return memberAvatar;
	}

	public void setMemberAvatar(String memberAvatar) {
		this.memberAvatar = memberAvatar;
	}

	public String getLastDate() {
		return Common.getDate(this.getGmtCreated());
	}

	public String getReplaceContent() {
		return Common.parseGuouojUrl(Common.atContentRep(Expression.replaceAll(content)),memberName);
	}
	
	public String getMeContent(){
		String realContent = content;
		if(!Common.empty(realContent)){
			if(realContent.length() > 140){
				realContent = realContent.substring(0, 140) + "...";
			}
		}
		return Common.parseGuouojUrl(Common.atContentRep(Expression.replaceAll(realContent)),memberName);
	}
	
	public String getShowContent() {
		if(content!=null && content.length()>28){
			content = content.substring(0, 28);
		}
		return Expression.replaceAll(content);
	}
	
	public String getDoingCreated() {
		return Common.getDate(this.gmtCreated);
	}

	public String getImageServer() {
		return imageServer;
	}

	public void setImageServer(String imageServer) {
		this.imageServer = imageServer;
	}

	public String getFormatDate() {
		return Common.getDate(gmtModified);
	}

	public Integer getForwards() {
		return forwards;
	}

	public void setForwards(Integer forwards) {
		this.forwards = forwards;
	}

	public String getRootId() {
		return rootId;
	}

	public void setRootId(String rootId) {
		this.rootId = rootId;
	}

	public String getToId() {
		return toId;
	}

	public void setToId(String toId) {
		this.toId = toId;
	}

	public String getToMember() {
		return toMember;
	}

	public void setToMember(String toMember) {
		this.toMember = toMember;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	
	public Doing getRootDoing() {
		return rootDoing;
	}

	public void setRootDoing(Doing rootDoing) {
		this.rootDoing = rootDoing;
	}

	public String getBaseType() {
		return baseType;
	}

	public void setBaseType(String baseType) {
		this.baseType = baseType;
	}

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	public String getVideoPic() {
		return videoPic;
	}

	public void setVideoPic(String videoPic) {
		this.videoPic = videoPic;
	}

	public String getOwner() {
		return owner;
	}

	public void setOwner(String owner) {
		this.owner = owner;
	}

	public String getOwnerType() {
		return ownerType;
	}

	public void setOwnerType(String ownerType) {
		this.ownerType = ownerType;
	}

	public Boolean getEnabled() {
		return enabled;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public List<DoingProduct> getDoingProductList() {
		return doingProductList;
	}

	public void setDoingProductList(List<DoingProduct> doingProductList) {
		this.doingProductList = doingProductList;
	}

	public List<DoingPicture> getDoingPictureList() {
		return doingPictureList;
	}

	public void setDoingPictureList(List<DoingPicture> doingPictureList) {
		this.doingPictureList = doingPictureList;
	}
	public String getCutContent() {
		return Common.cutStr(getContent(), 30, "...");
	}
	public String getCutContent100() {
		return Common.cutStr(getContent(), 100, "...");
	}
	
	public String getTurnReplaceContent(){
		return Common.nl2br(getReplaceContent());
	}
	@Override
	public boolean equals(Object obj) {
	    if(obj == null){
            return false;
        }
        Doing doing = (Doing)obj;
        if(this.identifier.equals(doing.getIdentifier())){
            return true;
        }else{
            return false;
        }
	}


	public String getPictorial() {
		return pictorial;
	}


	public void setPictorial(String pictorial) {
		this.pictorial = pictorial;
	}


	public DoingPictorial getPictorialObj() {
		return pictorialObj;
	}


	public void setPictorialObj(DoingPictorial pictorialObj) {
		this.pictorialObj = pictorialObj;
	}


	public Integer getTotalIPViewCount() {
		return totalIPViewCount;
	}


	public void setTotalIPViewCount(Integer totalIPViewCount) {
		this.totalIPViewCount = totalIPViewCount;
	}


	public Integer getLoveAmount() {
		return loveAmount;
	}


	public void setLoveAmount(Integer loveAmount) {
		this.loveAmount = loveAmount;
	}

	public String getMemberApproveStatus() {
		return memberApproveStatus;
	}

	public void setMemberApproveStatus(String memberApproveStatus) {
		this.memberApproveStatus = memberApproveStatus;
	}
	public String getMetaDescription(){
		if(!Common.empty(content)){
			if(content.length() > 50){
				return Common.htmlSpecialChars(content.substring(0, 50));
			}else{
				return Common.htmlSpecialChars(content);
			}
			
		}
		return null;
	}
	
}
